package com.kun.index.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 博客表
 * </p>
 *
 * @author kunkun
 * @since 2024-02-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("blog")
@ApiModel(value="Blog对象", description="博客表")
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "博客id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "博客标题")
    private String title;

    @ApiModelProperty(value = "博客内容")
    private String content;

    @ApiModelProperty(value = "发布人id")
    private Integer userId;

    @ApiModelProperty(value = "审核状态,1：审核通过")
    private Integer auditStatue;



    @ApiModelProperty(value = "点击量")
    private Integer hitsNum;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除，0：未删除，1：已删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    @ApiModelProperty(value = "发布人名称")
    @TableField(exist=false)
    private String userNickname;
    @ApiModelProperty(value = "发布人头像")
    @TableField(exist=false)
    private String avatarUrl;
    @ApiModelProperty(value = "该博客所包含的标签")
    @TableField(exist=false)
    private List<Label> labels;
    @ApiModelProperty(value = "该博客所包含的标签id")
    @TableField(exist=false)
    private List<Integer> labelIds;
    @ApiModelProperty(value = "点赞数")
    @TableField(exist=false)
    private Integer likeCount=0;
    @ApiModelProperty(value = "收藏数")
    @TableField(exist=false)
    private Integer collectionCount=0;


}
